package com.itheima.safe.service.impl;

import com.itheima.safe.service.AliyunSafeService;
import com.itheima.safe.util.AliyunSafeVerify;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Author：shenkunlin
 * @date： 2021/8/26 9:54
 * @Description：
 ***/
@Data
@Service
@ConfigurationProperties(prefix = "aliyun")
public class AliyunSafeServiceImpl implements AliyunSafeService {

    private String appid;

    private String secret;

    /***
     * 文本内容安全检测
     * @param contents：集合内容
     * @return
     */
    @Override
    public Boolean verifyText(List<String> contents) throws Exception {
        return AliyunSafeVerify.textVerify(appid,secret,contents);
    }

    /***
     * 图片检测
     * @param images：集合图片
     * @return
     */
    @Override
    public Boolean verifyImages(List<byte[]> images) throws Exception {
        return AliyunSafeVerify.verifyImages(appid,secret,images);
    }
}
